using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem;


namespace XFGameFramework.InputExtension 
{
    public static class MouseExtensions 
    {

        /// <summary>
        /// 根据ButtonControl获取GamepadButton
        /// </summary>
        /// <param name="gamepad"></param>
        /// <param name="buttonControl"></param>
        /// <returns></returns>
        public static MouseButton GetGamepadButton(this Mouse mouse, ButtonControl buttonControl)
        {
            if (buttonControl == mouse.backButton)
            {
                return MouseButton.BackButton;
            }
            else if (buttonControl == mouse.leftButton)
            {
                return MouseButton.LeftButton;
            }
            else if (buttonControl == mouse.rightButton)
            {
                return MouseButton.RightButton;
            }
            else if (buttonControl == mouse.forwardButton)
            {
                return MouseButton.ForwardButton;
            }
            else if (buttonControl == mouse.middleButton)
            {
                return MouseButton.MiddleButton;
            } 
            
            return MouseButton.None;
        }

    }

}

